﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/teleweb/common/global.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>中国通信服务</title>
<link href="teleweb/css/ztf.css" rel="stylesheet" type="text/css" />
<link href="teleweb/css/roll.css" rel="stylesheet" type="text/css" />
<link href="teleweb/css/content.css" rel="stylesheet" type="text/css" />
<script src="teleweb/js/gotoPage.js" type="text/javascript"></script>
<script type="text/javascript" src="${ctx}/js/jquery/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="${ctx}/teleweb/js/submitFunctions.js"></script>
</head>
<body>

<table width="960" border="0" align="center" cellpadding="0" cellspacing="0">
  <!-- 主体table -->
  <%request.setAttribute("panel","QA");%>
  <%@ include file="/teleweb/common/include/header.jsp" %>
        
  <tr>
    <!---首页内容--->
    <td class="new_indexcontent"><div class="new_stars">
        <div class="new_weizhi">你现在所在的位置：<a href="${ctx}/index">首页</a>><a href="${ctx}/listQuestionAnswer.action">员工问答</a></div>
      </div>
      <!---圆角--->
      <div class="box-cir3">
        <div class="t_l"></div>
        <div class="t_m"></div>
        <div class="t_r"></div>
        <div class="m_l"></div>
        <div class="m_m1">
          <!---标题内容--->
          <div class="new_heading1">
            <h3>员工问答</h3>
          </div>
            <table  class="new_neirong" cellpadding="0" cellspacing="0">
            <tr>
            	<th>问题名称</th>
            	<th width="120px" style="text-align:left;padding-left:10px;">发布日期</th>
            	<user:manager>
            	  <th width="120px" style="text-align:left;padding-left:10px;">
	            	 &nbsp;
	              </th>
            	</user:manager>
            </tr>
            
            <c:if test="${!empty publish.resultList}">
				<c:forEach items="${publish.resultList}" var="ks">
					<tr>
						<td class="new_tablepoint">
							<a title="${ks.question}" href="detailQuestionAnswer.action?pageSize=1&status=${ks.status}&id=${ks.id}&publish_pager.offset=${statusQA.index+offset}">${fn:substring(ks.question, 0, 40)}</a>
						</td>
	            		<td>${fn:substring(ks.publishDate, 0, 16)}&nbsp;</td>
	            		<user:manager>
	            			<td><a href="${ctx}/questionanswer-edit.action?id=${ks.id}">编辑</a> 
	            				<a onclick="return confirm('确定删除吗？');" href="${ctx}/questionanswer-delete.action?id=${ks.id}">删除</a>
	            			</td>
	            		</user:manager>
	            	</tr>
			    </c:forEach>
			</c:if>
            </table>
            
            <div class="new_pages">
            
	              <!-- 插入分页导航条 -->
	            <pg:pager id="publish_pager" url="listQuestionAnswer.action" maxPageItems="${publish.perPageRecordNum}" items="${publish.recordSum}" export="currentPageNumber=pageNumber">
					<pg:param name="pageSize" value="10"/>
					<pg:first>
						<a href="${pageUrl}">[ 首页]</a>|
					</pg:first>
					<pg:prev ifnull="true">
						<% if (pageUrl != null) { %>   
	        				<a HREF="<%=pageUrl%>">上一页</a>|
	      				<% } else { %>   
	        				&nbsp;上一页  |   
	      				<% } %>   
					</pg:prev>
					<pg:next ifnull="true">
						<% if (pageUrl != null) { %>   
	        				<a HREF="<%=pageUrl%>">下一页</a>|
	      				<% } else { %>   
	        				&nbsp;下一页  |   
	      				<% } %> 
					</pg:next>
					<pg:last>
						<a href="${pageUrl}">[ 末页]</a>
						第<span class="new_point"><%=currentPageNumber%>/<%=pageNumber%></span>页 
						每页${publish.perPageRecordNum}条 共<%=pageNumber%>页 
						到第<input type="text" name="pageNo" id="pageNo"><span class="new_pagesbg" onclick="gotoPage(${publish.recordSum},${publish.perPageRecordNum},'listQuestionAnswer','publish_pager')">页</span>
					</pg:last>
				</pg:pager>
            
             </div>
            
            <user:guest>
            <!--一般用户提问-->
	            <div class="new_questions">
		            <div class="new_questionse">
		            <h2>我要提问:</h2>
				    <s:form action ="addQuestionAnswer" method ="post" enctype ="multipart/form-data" id="addQAForm"> 
				        <textarea id="question" name ="question"></textarea>
				        <div class="new_btform">    
				            <button class="new_btforml" onclick="return submitAddQuestionAnswer(document.getElementById('addQAForm'));" >提交</button>
				            <button onclick="document.getElementById('addQAForm').reset();">重置</button>
				        </div>
				    </s:form > 
		            </div>
	            </div>
            </user:guest>
            
            <user:manager>
            	<div class="new_heading1">
	            	<h3>待解答问题</h3>
	            </div>
	            <table class="new_neirong" cellpadding="0" cellspacing="0">
	            <tr>
	            	<th>问题名称</th>
	            	<th width="120px" style="text-align:left;padding-left:10px;">提交日期</th>
	            	<th width="120px" style="text-align:left;padding-left:10px;">
	            		&nbsp;
	            	</th>
	            </tr>
	            
	            <c:if test="${!empty pending.resultList}">
					<c:forEach items="${pending.resultList}" var="ks" varStatus="statusQA">
						<tr>
							<td class="new_tablepoint">
								<a title="${ks.question}" href="detailQuestionAnswer.action?pageSize=1&status=${ks.status}&id=${ks.id}&pending_pager.offset=${statusQA.index+offset}">${fn:substring(ks.question, 0, 40)}</a>
							</td>
		            		<td>${fn:substring(ks.submitDate, 0, 16)}&nbsp;</td>
		            		<td>
	            			    <a href="${ctx}/questionanswer-edit.action?id=${ks.id}">解答</a> 
	            				<a onclick="return confirm('确定删除吗？');" href="${ctx}/questionanswer-delete.action?id=${ks.id}">删除</a>
		            		</td>
		            	</tr>
				    </c:forEach>
				</c:if>
	
	            </table>
	            <div class="new_pages">
	            
		              <!-- 插入分页导航条 -->
		            <pg:pager id="pending_pager" url="listQuestionAnswer.action" maxPageItems="${pending.perPageRecordNum}" items="${pending.recordSum}" export="currentPageNumber=pageNumber">
						<pg:param name="pageSize" value="10"/>
						<pg:first>
							<a href="${pageUrl}">[ 首页]</a>|
						</pg:first>
						<pg:prev ifnull="true">
							<% if (pageUrl != null) { %>   
		        				<a HREF="<%=pageUrl%>">上一页</a>|
		      				<% } else { %>   
		        				&nbsp;上一页  |   
		      				<% } %>   
						</pg:prev>
						<pg:next ifnull="true">
							<% if (pageUrl != null) { %>   
		        				<a HREF="<%=pageUrl%>">下一页</a>|
		      				<% } else { %>   
		        				&nbsp;下一页  |   
		      				<% } %> 
						</pg:next>
						<pg:last>
							<a href="${pageUrl}">[ 末页]</a>
							第<span class="new_point"><%=currentPageNumber%>/<%=pageNumber%></span>页 
							每页${pending.perPageRecordNum}条 共<%=pageNumber%>页 
							到第<input type="text" name="pageNo" id="pageNo"><span class="new_pagesbg" onclick="gotoPage(${pending.recordSum},${pending.perPageRecordNum},'listQuestionAnswer','pending_pager')">页</span>
						</pg:last>
					</pg:pager>
	            
	             </div>
            </user:manager>
            
        <div class="m_r"></div>
        <div class="b_l"></div>
        <div class="b_m"></div>
        <div class="b_r"></div>
      </div></td>
  </tr>
  <%@ include file="common/include/tail.jsp"%>
</table>

</body>
</html>
